﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin_Article.aspx.cs"
    Inherits="V5_EShop.Admin.Admin_Article" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <!--#include file="inc/libs.aspx"-->
    <script type="text/javascript">
        function checkform() {
            var title = $("#txtTitle").val();
            var classid = $("#ddlClassID").val();
            var content = $("#txtContent").val();
            if (title == "") {
                alert("标题不能为空!");
                return false;
            }
            if (classid == 0) {
                alert("请选择一个分类!");
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
    <table border="0" cellpadding="0" cellspacing="0" class="toptable" width="100%">
        <tr>
            <td class="topnavichar" style="padding-left: 14px">
                <div align="left">
                    位置导航：<a class="list_link" href="Admin_Index_Main.aspx" target="main">首页</a><img alt=""
                        border="0" src="/sysImages/folder/navidot.gif" />新闻中心</div>
            </td>
        </tr>
    </table>
    <br />
    <table align="center" border="0" cellpadding="0" cellspacing="0" class="Navitable"
        width="100%">
        <tr>
            <td align="left">
                <a href="Admin_Article.aspx">管理商品</a> | <a href="Admin_Article.aspx?Action=edit">添加</a>
            </td>
        </tr>
    </table>
    <br />
    <form id="form1" runat="server">
    <asp:MultiView ID="MultiViewList" runat="server">
        <asp:View ID="View1" runat="server">
            <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" 
                CssClass="listtable" GridLines="None" onrowcommand="gvList_RowCommand">
                 <HeaderStyle CssClass="headertext" />
                <Columns>
                    <asp:TemplateField HeaderText="选择">
                        <ItemTemplate>
                            <asp:CheckBox ID="chkitem" runat="server" />
                        </ItemTemplate>
                        <ItemStyle Width="30px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ID" HeaderText="ID">
                    <ItemStyle Width="30px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Title" HeaderText="标题" />
                    <asp:BoundField DataField="Editor" HeaderText="录入者/编辑者">
                    <ItemStyle Width="150px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Hits" HeaderText="点击">
                    <ItemStyle Width="40px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="审核">
                        <ItemTemplate>
                             <%# DataBinder.Eval(Container, "DataItem.Passed").ToString()=="1"?"√":"×"%>
                        </ItemTemplate>
                        <ItemStyle Width="40px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("ID") %>'
                                CommandName="go">修改</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%#Eval("ID") %>'
                                CommandName="del">删除</asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle Width="150px" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" class="listtable">
                <tr>
                    <td class="tdblank">
                        搜索：
                        <asp:TextBox ID="txtSearchText" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" CausesValidation="False" Text="搜 索" OnClick="btnSearch_Click" />
                    </td>
                </tr>
                <tr>
                    <td align="right" class="tdblank">
                        <input name="chkall" type="checkbox" id="chkall" onclick="javascript:SelectAll(this);"
                            value="checkbox" />
                        全选/取消
                        <asp:DropDownList ID="ddlAll" runat="server">
                            <asp:ListItem Value="0">请选择一个操作</asp:ListItem>
                            <asp:ListItem Value="1">批量删除</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnAll" runat="server" Text="执行操作" EnableViewState="False" OnClick="btnAll_Click" />
                    </td>
                </tr>
                <tr>
                    <td align="right" class="tdblank">
                        <webdiyer:AspNetPager ID="Pager" runat="server" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条"
                            FirstPageText="首页" HorizontalAlign="Right" LastPageText="尾页" NextPageText="下一页"
                            OnPageChanged="Pager_PageChanged" PageIndexBoxType="DropDownList" PageSize="20"
                            PrevPageText="上一页" ShowCustomInfoSection="Left" ShowPageIndexBox="Always" SubmitButtonText="Go"
                            TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" AlwaysShow="True">
                        </webdiyer:AspNetPager>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="View2" runat="server">
            <table align="center" border="0" cellpadding="5" cellspacing="1" class="edittable"
                width="96%">
                <tr>
                    <td colspan="4" class="headertext">
                        &nbsp;
                        <asp:Label ID="lblTitle" runat="server" Text="添加 文章"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right" style="height: 14px">
                        标题：
                    </td>
                    <td colspan="3" style="height: 14px">
                        <asp:TextBox ID="txtTitle" runat="server" Width="363px"></asp:TextBox>
                        &nbsp;
                        <asp:CheckBox ID="chkPassed" runat="server" Text="立即发布" Checked="True" />
                    </td>
                </tr>
                <tr>
                    <td align="right" style="height: 22px">
                        关键字：
                    </td>
                    <td colspan="3" style="height: 22px">
                        <asp:TextBox ID="txtKeys" runat="server" Width="361px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="height: 14px">
                        选择栏目：
                    </td>
                    <td colspan="3" style="height: 14px">
                        <asp:DropDownList ID="ddlClassID" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        来源：
                    </td>
                    <td width="36%">
                        <asp:TextBox ID="txtCopyFrom" runat="server" Width="124px"></asp:TextBox>
                    </td>
                    <td width="11%" align="right">
                        作者：
                    </td>
                    <td width="33%">
                        <asp:TextBox ID="txtAuthor" runat="server" Width="124px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        转向链接：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtLinkUrl" runat="server" Width="344px"></asp:TextBox>
                        <asp:CheckBox ID="chkLinkUrl" runat="server" Text="是" />
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        类型：
                    </td>
                    <td colspan="3">
                        <asp:CheckBox ID="chkIsOnTop" runat="server" Text="热门" />
                        <asp:CheckBox ID="chkRecommended" runat="server" Text="推荐" />
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        简介：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtShortContent" runat="server" Height="101px" TextMode="MultiLine"
                            Width="546px"></asp:TextBox>不要超过200个字符
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="top">
                        详细内容：<br />
                        <input id="Button4" type="button" value="插入图片" onclick="OpenUpload('txtContent',400,150);" /></td>
                    <td colspan="3" valign="top">
                        <FCKeditorV2:FCKeditor ID="txtContent" runat="server" BasePath="../FckEditor/" Height="350px"
                            Width="100%">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        图片：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtDefaultPicUrl" runat="server" Width="333px"></asp:TextBox>
                        <input id="Button1" onclick="OpenPictureDialog('txtDefaultPicUrl',620,450);"
                            type="button" value="上传文件" />
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        点击次数：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtHits" runat="server">0</asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="4" style="height: 22px">
                        <asp:HiddenField ID="txtID" runat="server" Value="0" />
                        <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="确认保存" OnClientClick="return checkform();" />
                        <input id="Reset1" type="reset" value="重新设置" />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    </form>
</body>
</html>
